ROTATE OBJECT

This command will rotate the specified 3D object around all three dimensions.

  Syntax
ROTATE OBJECT Object Number, XAngle, YAngle, ZAngle
  Parameters
Object Number
Integer
The object number
XAngle
Float
The x angle value
YAngle
Float
The y angle value
ZAngle
Float
The z angle value

  Returns

This command does not return a value.

  Description

The object number should be specified using an integer value. This method of rotation is called euler rotation and differs from free flight rotation. Euler angles retrieved from a free flight rotation specify a ZYX rotation, and you must call the SET OBJECT ROTATION ZYX command on the Euler based object to make the two rotation systems compatible. The rotation angles should be specified using real numbers.

  Example Code
sync on : sync rate 0 : hide mouse:cls 0
ObjectNumber=1
SecondObject=2
load object "model.x",ObjectNumber
load object "model.x",SecondObject
rotate object ObjectNumber, 270, 0, 0
fix object pivot ObjectNumber
point object ObjectNumber,0,0,0
position object ObjectNumber, 0,0,0
while mouseclick()=0
if inkey$()="r" then rotate object ObjectNumber, 0,wrapvalue(object angle y(1)+1),0
sync
endwhile
delete object ObjectNumber
delete object SecondObject
end
  See also

BASIC3D Commands Menu
Index